package com.wise.sample2.component;

import com.wise.domain.Bar2;
import com.wise.domain.Foo2;
import org.springframework.context.annotation.Profile;
import org.springframework.kafka.annotation.KafkaHandler;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;


@Component
@KafkaListener(id = "multiGroup", topics = {"foos", "bars"})
@Profile(value = "sample2")
public class MultiMethods {

    @KafkaHandler
    public void fooHandler(Foo2 foo) {
        System.out.println("Received: " + foo);
    }

    @KafkaHandler
    public void barHandler(Bar2 bar) {
        System.out.println("Received: " + bar);
    }

    @KafkaHandler(isDefault = true)
    public void unknown(Object object) {
        System.out.println("Received unknown: " + object);
    }
}
